<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "order_address".
 *
 * @property int $id
 * @property int $order_id
 * @property int|null $customer_address_id Customer Address Id
 * @property int|null $quote_address_id Quote Address Id
 * @property int|null $region_id Region Id
 * @property int|null $customer_id Customer Id
 * @property string $fax Fax
 * @property string $region Region
 * @property string $postcode Postcode
 * @property string $lastname Lastname
 * @property string $street Street
 * @property string $city City
 * @property string $email Email
 * @property string $telephone Telephone
 * @property string $country_id Country Id
 * @property string $firstname Firstname
 * @property string $address_type Address Type
 * @property string $prefix Prefix
 * @property string $middlename Middlename
 * @property string $suffix Suffix
 * @property string $company Company
 * @property string $vat_id Vat Id
 * @property int|null $vat_is_valid Vat Is Valid
 * @property string $vat_request_id Vat Request Id
 * @property string $vat_request_date Vat Request Date
 * @property int|null $vat_request_success Vat Request Success
 * @property int $created_at
 * @property int $updated_at
 * @property string $md5address
 * @property string $fullname
 */
class OrderAddress extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'order_address';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['order_id', 'fax', 'region', 'postcode', 'lastname', 'street', 'city', 'email', 'telephone', 'country_id', 'firstname', 'address_type', 'prefix', 'middlename', 'suffix', 'company', 'vat_id', 'vat_request_id', 'vat_request_date', 'created_at', 'updated_at', 'md5address', 'fullname'], 'required'],
            [['order_id', 'customer_address_id', 'quote_address_id', 'region_id', 'customer_id', 'vat_is_valid', 'vat_request_success', 'created_at', 'updated_at'], 'integer'],
            [['vat_id', 'vat_request_id', 'vat_request_date'], 'string'],
            [['fax', 'region', 'postcode', 'lastname', 'street', 'city', 'email', 'telephone', 'firstname', 'address_type', 'prefix', 'middlename', 'suffix', 'company'], 'string', 'max' => 255],
            [['country_id'], 'string', 'max' => 2],
            [['md5address'], 'string', 'max' => 32],
            [['fullname'], 'string', 'max' => 64],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'order_id' => Yii::t('app', 'Order ID'),
            'customer_address_id' => Yii::t('app', 'Customer Address ID'),
            'quote_address_id' => Yii::t('app', 'Quote Address ID'),
            'region_id' => Yii::t('app', 'Region ID'),
            'customer_id' => Yii::t('app', 'Customer ID'),
            'fax' => Yii::t('app', 'Fax'),
            'region' => Yii::t('app', 'Region'),
            'postcode' => Yii::t('app', 'Postcode'),
            'lastname' => Yii::t('app', 'Lastname'),
            'street' => Yii::t('app', 'Street'),
            'city' => Yii::t('app', 'City'),
            'email' => Yii::t('app', 'Email'),
            'telephone' => Yii::t('app', 'Telephone'),
            'country_id' => Yii::t('app', 'Country ID'),
            'firstname' => Yii::t('app', 'Firstname'),
            'address_type' => Yii::t('app', 'Address Type'),
            'prefix' => Yii::t('app', 'Prefix'),
            'middlename' => Yii::t('app', 'Middlename'),
            'suffix' => Yii::t('app', 'Suffix'),
            'company' => Yii::t('app', 'Company'),
            'vat_id' => Yii::t('app', 'Vat ID'),
            'vat_is_valid' => Yii::t('app', 'Vat Is Valid'),
            'vat_request_id' => Yii::t('app', 'Vat Request ID'),
            'vat_request_date' => Yii::t('app', 'Vat Request Date'),
            'vat_request_success' => Yii::t('app', 'Vat Request Success'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'md5address' => Yii::t('app', 'Md5address'),
            'fullname' => Yii::t('app', 'Fullname'),
        ];
    }
}
